using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace EFDemo
{

    public enum MajorTypeEnum
    {
        [Display(Name = "必修")]
        Required,
        [Display(Name = "选修")]
        Optional
    }

    public class Major
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int ID { get; set; }

        public string MajorCode { get; set; }

        public string MajorName { get; set; }

        public MajorTypeEnum? MajorType { get; set; }

        public string Remark { get; set; }

        [Required()]
        public int? SchoolId { get; set; }

        public School School { get; set; }

        public List<StudentMajor> StudentMajors { get; set; }

    }

    public class Major2
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int ID { get; set; }

        public string MajorCode { get; set; }

        public string MajorName { get; set; }

        public MajorTypeEnum? MajorType { get; set; }

        public string Remark { get; set; }

        public string SchoolName { get; set; }

    }

}
